<!doctype html>
<html lang="zh-CN"><head><script src="/livereload.js?mindelay=10&amp;v=2&amp;port=1313&amp;path=livereload" data-no-instant defer></script>
    <title>薛尧的博客</title>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <meta name="description" content="" />

    
    
    
    <link rel="stylesheet" href="../../../css/theme.min.css">

    
    
    
    
    <link rel="stylesheet" href="../../../css/custom.min.css">
    

    
</head>
<body>
        <div id="content" class="mx-auto"><header class="container mt-sm-5 mt-4 mb-4 mt-xs-1">
    <div class="row">
        
        <div class="col-sm-4 col-12 text-sm-right text-center pt-sm-4">
            <a href="../../../" class="text-decoration-none">
                <img id="home-image" class="rounded-circle"
                    
                        src="https://ueyao.github.io/image-hosting/blog/avatar.png"
                    
                />
            </a>
        </div>
        <div class="col-sm-8 col-12 text-sm-left text-center">
        
            <h2 class="m-0 mb-2 mt-4">
                <a href="../../../" class="text-decoration-none">
                    
                        薛尧
                    
                </a>
            </h2>
            <p class="text-muted mb-1">
                
                    Java Developer | Short Video Creator
                
            </p>
            <ul id="nav-links" class="list-inline mb-2">
                
                
                    <li class="list-inline-item">
                        <a class="badge badge-white " href="../../../about/" title="关于">关于</a>
                    </li>
                
                    <li class="list-inline-item">
                        <a class="badge badge-white " href="../../../post/" title="文章">文章</a>
                    </li>
                
                    <li class="list-inline-item">
                        <a class="badge badge-white " href="../../../categories/" title="分类">分类</a>
                    </li>
                
            </ul>
            <ul id="nav-social" class="list-inline">
                
                    <li class="list-inline-item mr-3">
                        <a href="http://github.com/flowstone" target="_blank">
                            <i class="fab fa-github fa-1x text-muted"></i>
                        </a>
                    </li>
                
                    <li class="list-inline-item mr-3">
                        <a href="mailto:xueyao.me#gmail.com" target="_blank">
                            <i class="fas fa-at fa-1x text-muted"></i>
                        </a>
                    </li>
                
            </ul>
        </div>
    </div>
    <hr />
</header>
<div class="container">
    <div class="pl-sm-2">
        <div class="mb-3">
            <h3 class="mb-0">Java编程思想学习总结一(一切都是对象)</h3>
            
            <small class="text-muted">发布于 2019-02-07</small>
        </div>

        <article>
            <h1 id="heading"></h1>
<h2 id="存储位置">存储位置</h2>
<ul>
<li>寄存器</li>
<li>堆栈  存储对象引用，堆栈指针向下移动，分配新的内存，向上移动，释放内存</li>
<li>堆  存储Java对象</li>
<li>常量存储  存储常量值</li>
<li>非RAM存储      存储流对象和持久化对象</li>
</ul>
<h2 id="基本类型所占存储空间">基本类型所占存储空间</h2>
<table>
  <thead>
      <tr>
          <th>基本类型</th>
          <th>大小</th>
          <th>包装器类型</th>
          <th>默认值</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td>boolean</td>
          <td>16bit</td>
          <td>Boolean</td>
          <td>false</td>
      </tr>
      <tr>
          <td>char</td>
          <td>16bit</td>
          <td>Character</td>
          <td>‘\u0000’（null）</td>
      </tr>
      <tr>
          <td>byte</td>
          <td>8bit</td>
          <td>Byte</td>
          <td>0</td>
      </tr>
      <tr>
          <td>short</td>
          <td>16bit</td>
          <td>Short</td>
          <td>0</td>
      </tr>
      <tr>
          <td>int</td>
          <td>32bit</td>
          <td>Integer</td>
          <td>0</td>
      </tr>
      <tr>
          <td>long</td>
          <td>64bit</td>
          <td>Long</td>
          <td>0L</td>
      </tr>
      <tr>
          <td>float</td>
          <td>32bit</td>
          <td>Float</td>
          <td>0.0F</td>
      </tr>
      <tr>
          <td>double</td>
          <td>64bit</td>
          <td>Double</td>
          <td>0.0D</td>
      </tr>
  </tbody>
</table>
<p>永远不需要销毁对象</p>
<p>执行new来创建对象时，数据存储空间才被分配</p>
<p>static作用于某个字段时，都只有一份存储空间</p>
<h2 id="文档注释">文档注释</h2>
<p>javadoc只能为public和protected成员进行文档注释</p>
<p>@see  : 引用其化类</p>
<p>{@link package.class#member label}  用于行内，并且是用label作为超链接</p>
<p>{@docRoot} 该标签产生到文档根目录的相对路径，用于文档树页面的显式超链接</p>
<p>{@inheritDoc} 该标签从当前这个类的最直接的基类中继承相关文档到当前的文档注释中</p>
<p>@version  生成版本</p>
<p>@author  作者信息</p>
<p>@since  该标签允许你指定程序代码最早使用的版本</p>
<p>@parm  参数列表的标识符</p>
<p>@return  用来描述返回值的含义，可以延续数行</p>
<p>@throws  异常说明</p>
<p>@deprecated  该标签用于指出一些旧特性已由改进的新特性所取代</p>
<h2 id="编码风格">编码风格</h2>
<p>类名的首字母要大写，如果几个单词构成，每个单词首字母都采用大写形式</p>

        </article>
    </div>

    <div id="disqus_thread"></div>
<script>
    window.disqus_config = function () {
    
    
    
    };
    (function() {
        if (["localhost", "127.0.0.1"].indexOf(window.location.hostname) != -1) {
            document.getElementById('disqus_thread').innerHTML = 'Disqus comments not available by default when the website is previewed locally.';
            return;
        }
        var d = document, s = d.createElement('script'); s.async = true;
        s.src = '//' + "xie-yao-de-bo-ke" + '.disqus.com/embed.js';
        s.setAttribute('data-timestamp', +new Date());
        (d.head || d.body).appendChild(s);
    })();
</script>
<noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
<a href="https://disqus.com" class="dsq-brlink">comments powered by <span class="logo-disqus">Disqus</span></a>

            </div>
        </div><footer class="text-center pb-1">
    <small class="text-muted">
        
        &copy; Copyright 2024
        
        |
        <a href="https://beian.miit.gov.cn/" target="_blank">苏ICP备14012079号</a>
        <br />
        由 <a href="https://gohugo.io/" target="_blank">Hugo</a> 强力驱动
        | 主题 <a href="https://github.com/austingebauer/devise" target="_blank">Devise</a>
        <br />

    </small>
</footer></body>
</html>
